package org.dao.imp;




import org.dao.XsDao;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.model.Xsb;

public class XsDaoImp implements XsDao {
	public Xsb getOneXs(String xh) {
		try {
			Session session=org.util.HibernateSessionFactory.getSession();
			Transaction ts=session.beginTransaction();
			Query query=session.createQuery("from Xsb where xh=?");
			Xsb xs=(Xsb)query.uniqueResult();
			ts.commit();
			session.clear();
			return xs;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public void update(Xsb xs) {

	}
}
